import type { FileSystemItem } from "../types/fileSystem";

// 用于虚拟滚动性能测试的大量数据
export const testFileSystemData: Record<string, FileSystemItem[]> = {
  // 大文件列表测试 - 1000个文件
  "/C:/Users/Administrator/Desktop/大文件列表测试": [
    ...Array.from({ length: 1000 }, (_, i) => ({
      name: `测试文件_${String(i + 1).padStart(4, "0")}.${
        ["txt", "docx", "xlsx", "pdf", "jpg", "png", "mp4", "zip"][i % 8]
      }`,
      type: "file" as const,
      size: Math.floor(Math.random() * 10485760) + 1024, // 1KB to 10MB
      extension: ["txt", "docx", "xlsx", "pdf", "jpg", "png", "mp4", "zip"][
        i % 8
      ],
      lastModified: new Date(2024, 0, Math.floor(Math.random() * 31) + 1),
    })),
    // 50个测试文件夹
    ...Array.from({ length: 50 }, (_, i) => ({
      name: `文件夹_${String(i + 1).padStart(3, "0")}`,
      type: "folder" as const,
      lastModified: new Date(2024, 0, Math.floor(Math.random() * 31) + 1),
      children: [],
    })),
  ],

  // 超大文件列表测试 - 5000个文件用于极限测试
  "/C:/Users/Administrator/Desktop/超大文件列表测试": [
    ...Array.from({ length: 5000 }, (_, i) => ({
      name: `性能测试文件_${String(i + 1).padStart(5, "0")}.${
        [
          "txt",
          "docx",
          "xlsx",
          "pptx",
          "pdf",
          "jpg",
          "png",
          "mp4",
          "mp3",
          "zip",
        ][i % 10]
      }`,
      type: "file" as const,
      size: Math.floor(Math.random() * 104857600) + 1024, // 1KB to 100MB
      extension: [
        "txt",
        "docx",
        "xlsx",
        "pptx",
        "pdf",
        "jpg",
        "png",
        "mp4",
        "mp3",
        "zip",
      ][i % 10],
      lastModified: new Date(
        2024,
        Math.floor(Math.random() * 12),
        Math.floor(Math.random() * 28) + 1
      ),
    })),
    // 200个测试文件夹
    ...Array.from({ length: 200 }, (_, i) => ({
      name: `性能测试文件夹_${String(i + 1).padStart(4, "0")}`,
      type: "folder" as const,
      lastModified: new Date(
        2024,
        Math.floor(Math.random() * 12),
        Math.floor(Math.random() * 28) + 1
      ),
      children: [],
    })),
  ],

  // 为测试文件夹添加路径条目
  ...Array.from({ length: 50 }, (_, i) => {
    const folderName = `文件夹_${String(i + 1).padStart(3, "0")}`;
    return {
      [`/C:/Users/Administrator/Desktop/大文件列表测试/${folderName}`]: [],
    };
  }).reduce((acc, obj) => ({ ...acc, ...obj }), {}),

  ...Array.from({ length: 200 }, (_, i) => {
    const folderName = `性能测试文件夹_${String(i + 1).padStart(4, "0")}`;
    return {
      [`/C:/Users/Administrator/Desktop/超大文件列表测试/${folderName}`]: [],
    };
  }).reduce((acc, obj) => ({ ...acc, ...obj }), {}),
};
